import { NextResponse } from "next/server"

/**
 * 获取用户粉丝列表
 *
 * @route GET /api/user/followers
 * @param {number} page - 页码，默认为1
 * @param {number} limit - 每页数量，默认为20
 *
 * @returns {Object} 返回用户的粉丝列表
 *
 * 请求示例:
 * GET /api/user/followers?page=1&limit=20
 * Authorization: Bearer <token>
 *
 * 返回示例:
 * {
 *   "success": true,
 *   "data": [
 *     {
 *       "id": "1",
 *       "name": "音乐爱好者",
 *       "avatar": "/images/user-avatar.jpg",
 *       "followedAt": "2023-06-01T12:00:00Z"
 *     },
 *     // ... 更多粉丝
 *   ],
 *   "pagination": {
 *     "currentPage": 1,
 *     "totalPages": 5,
 *     "totalItems": 100
 *   }
 * }
 */
export async function GET(request: Request) {
  const { searchParams } = new URL(request.url)
  const page = Number(searchParams.get("page") || "1")
  const limit = Number(searchParams.get("limit") || "20")

  // 实现获取用户粉丝列表逻辑
  return NextResponse.json({
    success: true,
    data: [
      {
        id: "1",
        name: "音乐爱好者",
        avatar: "/images/user-avatar.jpg",
        followedAt: "2023-06-01T12:00:00Z",
      },
      // ... 更多粉丝
    ],
    pagination: {
      currentPage: page,
      totalPages: 5,
      totalItems: 100,
    },
  })
}

